import { RouteRecordRaw } from "vue-router";
import IndexPage from "@/pages/IndexPage.vue";
import Page404 from "@/pages/404Page.vue";
/**
 * 路由列表
 */
export default [
  {
    path: "/",
    component: IndexPage,
    props: true,
  }, {
    path: "/about",
    component: () => import("@/pages/AboutPage.vue"),
    props: true,
  }, {
    path: "/medicine",
    children: [
      {
        path: "",
        component: () => import("@/pages/medicine/MedicineList.vue"),
        props: true,
      }, {
        path: "add",
        component: () => import("@/pages/medicine/MedicineAdd.vue"),
        props: true,
      }, {
        path: ":id",
        component: () => import("@/pages/medicine/MedicineDetail.vue"),
        props: true,
      }
    ],
  }, {
    path: "/member",
    children: [
      {
        path: "",
        component: () => import("@/pages/member/MemberList.vue"),
        props: true,
      }, {
        path: ":id",
        component: () => import("@/pages/member/MemberDetail.vue"),
        props: true,
      }
    ]
  }, {
    // 通知列表
    path: "/notice",
    children: [
      {
        path: "",
        component: () => import("@/pages/notice/NoticeList.vue"),
        props: true,
      }
    ],
  }, {
    path: "/auth",
    redirect: "/auth/login",
    children: [
      {
        path: "login",
        component: () => import("@/pages/auth/UserLoginPage.vue"),
        props: true,
      }, {
        path: "register",
        component: () => import("@/pages/auth/UserRegisterPage.vue"),
        props: true,
      }, {
        path: "logout",
        component: () => import("@/pages/auth/UserLogoutPage.vue"),
        props: true,
      }, {
        path: "wx/login",
        component: () => import("@/pages/auth/WxLoginPage.vue"),
        props: true,
      }
    ]
  }, {
  // 404页面
    path: "/404",
    component: Page404,
  }, //{
    // path: "/:pathMatch(.*)*",
    // redirect: "/404",
  // },
] as RouteRecordRaw[];
